using System;
using System.Collections.Generic;
using Library.Dto;
using NHibernate;

namespace Library.Persistence.Cloud.Dao
{
	public class CloudCustomDao
	{
		public string CloudLogin(string firmaKodu, string kullaniciAdi, string sifre)
		{
			const string sql = @"
SELECT FK.FIRMA_KULLANICI_ID AS Sonuc
  FROM CLOUD_FIRMA F, CLOUD_FIRMA_KULLANICI FK
 WHERE F.FIRMA_ID = FK.FIRMA_ID
   AND F.FIRMA_KODU = :firmaKodu
   AND FK.KULLANICI_ADI = :kullaniciAdi
   AND FK.SIFRE = :sifre  
			              ";
			FinderParameter[] parameters = new FinderParameter[3];
			parameters[0] = new FinderParameter("parameter", "firmaKodu", firmaKodu);
			parameters[1] = new FinderParameter("parameter", "kullaniciAdi", kullaniciAdi);
			parameters[2] = new FinderParameter("parameter", "sifre", sifre);
			return BasePersistence.ScalarQuery(sql, "sonuc", parameters, NHibernateUtil.String) as String;
		}

	}
}
